<template>
  <div>
    <h1>登录</h1>
    账号:<input type="text" v-model="username"/><br>
    密码:<input type="text" v-model="password"/><br>
    <input type="button" @click="login" value="登录"/>
    {{showtime}}
  </div>
</template>

<script>
import axios from "axios"; 
export default {
  data() {
    return {
      username: '',
      password: '',
      showtime: '',
    }
  },
    methods: {
      login() {
        axios.get("/login?username="
        + this.username + "&password="+ this.password).then(res=>{
        this.showtime = res.data.msg
      }).catch();
    }
  }
}
</script>

<style>

</style>